/*
 * @Description:
 * @Author: fhw
 * @Date: 2022-08-08 18:25:40
 */
import { Body, Controller, HttpCode, Post } from '@nestjs/common'
import { SysMessageService } from './sys_message.service'
import { CreateSysMessageDto, UpdateSysMessageDto } from './dto/sys_message.dto'
import { ApiBody, ApiOperation, ApiQuery, ApiTags } from '@nestjs/swagger'
@Controller('sys-message')
@ApiTags('系统消息')
export class SysMessageController {
  constructor(
    private readonly sysMessageService: SysMessageService,
  ) { }
  async createSysMessage(params: CreateSysMessageDto) {
    const data = await this.sysMessageService.createSysMessage(params)
    return data
  }

  @HttpCode(200)
  @Post('/updateSysMessage')
  @ApiQuery({
    description: '更新消息',
    type: UpdateSysMessageDto,
  })
  @ApiBody({ description: '更新消息', type: UpdateSysMessageDto })
  @ApiOperation({ summary: '更新消息', operationId: 'updateSysMessage' })
  async updateSysMessage(@Body() body: UpdateSysMessageDto) {
    const data = await this.sysMessageService.updateSysMessage(body)
    return data
  }
}
